package com.wzy.springbootdemo.controller;

import com.wzy.springbootdemo.config.ConfigInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloController {

    @Value("${student.name}")
    private String name;

    @Autowired
    private ConfigInfo configInfo;

    @GetMapping("/hello")
    public String hello(){
        return "Hello SpringBoot, "+name+",age:"+configInfo.getAge();
    }
}
